package com.sumainfor.wx.tenant.controller.gmio;

import com.sumainfor.wx.tenant.service.impl.GmioFeign.FinancialProviderService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author Eddy·Chen
 * @Email 835033913@qq.com
 * @Create 2019-04-21 12:59
 */
@RestController
@RequestMapping("/provider/key/tenant/financial")
public class FinancialProviderController {

    @Autowired
    private FinancialProviderService fps;

    /**
     * 查询租客信息数据
     *
     * @param params
     * @return
     */
    @PostMapping("/selectTenantInfo")
    public List<Map<String, Object>> selectTenantInfo(@RequestBody Map<String, Object> params) {
        String search = MapUtils.getString(params, "search", "");
        List<String> ids = (List<String>) MapUtils.getObject(params, "ids");
        if (CollectionUtils.isEmpty(ids)) {
            return null;
        }
        return fps.selectTenantInfo(search, ids);
    }

}
